<template>
  <div class="outside">
    <div class="layer">
      <div>
        <div class="i" id=""></div>
      </div>
    </div>
    <!-- <img src="https://cloudimge.com/image/2MmO6.png" class="wave"> -->
    <div class="container">
      <div class="img">
        <img src="../../assets/img/1781611.svg" alt="" />
      </div>
      <div class="login-content">
        <form>
          <h2 class="title">欢迎注册</h2>
          <div class="input-div one">
            <div class="i">
              <i class="fas fa-user"></i>
            </div>
            <div class="div">
              <h5>用户名</h5>
              <input type="text" class="input" />
            </div>
          </div>
          <div class="input-div pass">
            <div class="i">
              <i class="fas fa-lock"></i>
            </div>
            <div class="div">
              <h5>密码</h5>
              <input type="password" class="input" />
            </div>
          </div>
          <div class="input-div pass">
            <div class="i">
              <i class="fas fa-address-card"></i>
            </div>
            <div class="div">
              <h5>确认密码</h5>
              <input type="password" class="input" />
            </div>
          </div>
          <div class="input-div pass">
            <div class="i">
              <i class="fas fa-envelope"></i>
            </div>
            <div class="div">
              <h5>邮箱地址</h5>
              <input type="text" class="input" />
            </div>
          </div>
          <a @click="login">去登录</a>

          <div class="btn" @click="Sub">注册</div>
        </form>
      </div>
    </div>
  </div>
</template>

<script>
  import { defineComponent } from "vue";

  export default defineComponent({
    name: "Singin",
    methods: {
      Sub() {
        this.$router.push("/login");
      },
      login() {
        this.$router.push("/login");
      },
    },
  });
</script>

<style scoped>
  .outside {
    /* 标准盒子 */
    box-sizing: border-box;
    /* 引入字体 */
    font-family: "Poppins", sans-serif;
    /* 溢出隐藏 */
    overflow: hidden;
    background-image: url(../../assets/img/background.jpg);
  }
  /* 弹出层 */
  .layer {
    /* 定位 */
    position: absolute;
    /* 宽高 */
    margin-top: 35px;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    width: 300px;
    height: 100px;
    font-size: 20px;
    /* 背景 */
    background: rgba(0, 0, 0, 0.5);
    /* 居中 */
    top: 0;
    left: 0;
    /* 隐藏 */
    display: block;
    z-index: 999;
    display: none;
  }
  /* 弹出层文字样式 */
  .layer div div {
    margin-top: 35px;
    text-align: center;
  }
  #success {
    color: #f6ab4a;
  }
  #error {
    color: #f44336;
  }

  .wave {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 100%;
    /* 让他当作一个背景 */
    z-index: -1;
  }

  .container {
    width: 100vw;
    height: 100vh;
    /* 网格布局 */
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 7rem;
    padding: 0 2rem;
  }

  .img {
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  .login-content {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    /* 文字居中 */
    text-align: center;
  }

  .img img {
    width: 900px;
  }

  form {
    width: 360px;
  }

  .login-content img {
    height: 100px;
  }

  .login-content h2 {
    margin: 15px 0;
    color: #f8b359;
    text-transform: uppercase;
    font-size: 2.9rem;
  }

  .login-content .input-div {
    /* 相对定位 */
    position: relative;
    display: grid;
    grid-template-columns: 7% 93%;
    margin: 25px 0;
    padding: 5px 0;
    border-bottom: 2px solid #ffffff;
  }

  .login-content .input-div.one {
    margin-top: 0;
  }

  .i {
    color: #ffffff;
    /* 弹性布局 水平 垂直居中 */
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .i i {
    transition: 0.3s;
  }

  .input-div > div {
    /* 相对定位 */
    position: relative;
    height: 45px;
  }

  .input-div > div > h5 {
    /* 绝对定位 */
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
    transition: 0.3s;
  }

  .input-div::before,
  .input-div::after {
    content: "";
    /* 绝对定位 */
    position: absolute;
    bottom: -2px;
    width: 0%;
    height: 2px;
    background-color: #f6ab4a;
    transition: 0.4s;
  }

  .input-div::before {
    right: 50%;
  }

  .input-div::after {
    left: 50%;
  }

  .input-div.focus::before,
  .input-div.focus::after {
    width: 50%;
  }

  .input-div.focus > div > h5 {
    top: -5px;
    font-size: 15px;
  }

  .input-div.focus > .i > i {
    color: #f6ab4a;
  }

  .input-div > div > input {
    /* 绝对定位 */
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border: none;
    /* 点击输入框的边框也消失 */
    outline: none;
    padding: 0.5rem 0.7rem;
    background: none;
    font-size: 1.2rem;
    color: #c1c1c1;
    font-family: "position", sans-serif;
  }
  .input-div.pass {
    margin-bottom: 4px;
  }
  a {
    display: block;
    text-align: right;
    /* 下划线消失 */
    text-decoration: none;
    color: #999;
    font-size: 0.9rem;
    transition: 0.3s;
  }
  a:hover {
    color: #f6ab4a;
  }
  .btn {
    display: block;
    width: 100%;
    height: 50px;
    line-height: 50px;
    border-radius: 25px;
    outline: none;
    border: none;
    background-color: #f6ab4a;
    background-size: 200%;
    font-size: 1.2rem;
    color: #ffff;
    font-family: "Poppins", sans-serif;
    text-transform: uppercase;
    margin: 1rem 0;
    /* 鼠标放上变小手 */
    cursor: pointer;
    transition: 0.5s;
  }
  /* 添加样式 */
  /* form a{
    display: flex;
    justify-content: space-between;
} */
  .menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
  }
  .btn:hover {
    background-color: #ff8622;
  }

  @media screen and (max-width: 1050px) {
    .container {
      grid-gap: 5rem;
    }
  }

  @media screen and (max-width: 1000px) {
    form {
      width: 290px;
    }
    .login-content h2 {
      font-size: 2.4rem;
      margin: 8px 0;
    }
    .img img {
      width: 400px;
    }
  }

  @media screen and (max-width: 900px) {
    .container {
      grid-template-columns: 1fr;
    }
    .img {
      display: none;
    }
    .wave {
      display: none;
    }
    .login-content {
      justify-content: center;
    }
  }
</style>
